<%@page import="com.sun.mail.iap.ConnectionException"%>
<%@page import="java.sql.SQLException"%>
<%@page import="java.sql.Date"%>
<%@page import="form.ConnectionDB"%>
<%@page import="java.sql.ResultSet"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<jsp:include page="Admin_includes/header.jsp"></jsp:include>
<style type="text/css">
.xoa {
	text-indent: -99999px;
	width: 28px;
	height: 23px;
	background: url("Admin_images/xoa.png") no-repeat center;
	border: none;
}

.sua {
	text-indent: -99999px;
	width: 28px;
	height: 23px;
	background: url("Admin_images/sua.png");
	border: none;
}
</style>
<div id="center-content">
	<div id="left">
		<jsp:include page="Admin_includes/left.jsp"></jsp:include>
	</div>
	<!-- end left -->







	<div id="right">
		<a href="Admin_thuthuat.jsp" class="btlink">Danh sách thủ thuật</a> <a
			href="Admin_themthuthuat.jsp" class="btlink">Thêm thủ thuật</a>
		<fieldset>
			<table class="table1" width="740">
				<legend> Danh sách thủ thuật</legend>
				<tr>
					<th>Id</th>
					<th>Hình</th>
					<th>Title</th>
					<th>Ngày viết</th>
					<th>Nội dung</th>
					<th>Sửa</th>
					<th>Xóa</th>
				</tr>

				<tr>
					<%
						String sql = "select * from thuthuat";
						String err = "";
						String sukien = "";
						ResultSet rs = null;
						try {
							rs = ConnectionDB.getConnection().createStatement()
									.executeQuery(sql);
					%>

					<%
						while (rs.next()) {
								int thuthuat_id = rs.getInt("thuthuat_id");
								String hinh = rs.getString("hinh");
								String title = rs.getString("title");
								Date ngayviet = rs.getDate("ngayviet");
								String noidung = rs.getString("noidung");
					%>
					<td><%=thuthuat_id%></td>
					<td><img src="<%=hinh%>" width="30" height="30"></td>
					<td><%=title%></td>
					<td><%=ngayviet%></td>
					<td class="noidung" style="padding: 2px;">
						<form>
							<textarea name="" cols="" rows="" readonly
								style="width: 100px; height: 40px; margin: 0px; padding: 0px"><%=noidung%></textarea>

						</form>

					</td>
					<td class="suaxoa"><form action="Admin_suathanhvien.jsp"
							method="post">
							<input type="submit" value="<%=thuthuat_id%>" name="email"
								class="sua" title="Sửa" />
						</form></td>


					<td class="suaxoa"><form action="xoathanhvien" method="post">

							<input type="submit" onclick="return confirmAction()"
								value="<%=thuthuat_id%>" name="email" class="xoa" title="Xóa" />

						</form></td>
				</tr>
				<%
					}
				%>
				<%
					} catch (Exception e) {
						err = "Hệ thống chưa kết nối cơ sở dữ liệu!Chúng tôi sẽ nhanh chóng khắc phục!";
					}
				%>
			</table>
		</fieldset>

	</div>
	<label style="color: #EE2C2C; font-size: 18px; font-weight: bold;"><%=err%></label>
	<!-- end right -->




</div>
<!-- end center-content-->
<jsp:include page="Admin_includes/footer.jsp"></jsp:include>